<script setup>
import {ref} from "vue"
import useTodo from "../composable/useTodo.js";
const title = ref('')
const onSubmit = () => {
  useTodo().add({content: title.value})
  title.value = ''
}
</script>

<template>
  <div class="add">
    <input type="text" v-model="title" placeholder="回车提交任务" @keyup.enter="onSubmit" />
  </div>
</template>

<style scoped>
.add{
  display: flex;
}
.add input{
  border: solid 5px rgb(47, 194, 186);
  outline: none;
  padding:10px;
  flex: 1;
}
</style>